package com.jiayinlending.jiayindai.activity.home;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.OrientationHelper;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.widget.TextView;

import com.jiayinlending.jiayindai.R;
import com.jiayinlending.jiayindai.adapter.RecordAdpater;
import com.jiayinlending.jiayindai.net.bean.Info;

import java.util.ArrayList;

import butterknife.Bind;
import butterknife.ButterKnife;

public class RecordActivity extends AppCompatActivity {
    @Bind(R.id.toolbar_title)
    TextView toolbarTitle;
    @Bind(R.id.toolbar)
    Toolbar toolbar;
    @Bind(R.id.recyler_record)
    RecyclerView recylerRecord;
    /*
    * 投资记录
    * */

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_record);
        ButterKnife.bind(this);
        initview();
        inititleView();
    }

    private void initview() {
        ArrayList<Info> list2 = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            list2.add(new Info());
        }
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        recylerRecord.setLayoutManager(layoutManager);
        layoutManager.setOrientation(OrientationHelper.VERTICAL);
        recylerRecord.setAdapter(new RecordAdpater(this, list2));
    }

    private void inititleView() {
        toolbarTitle.setText("投资记录");
    }
}
